/**
 * 
 */
package com.cqcis.uip.module.salary.oper.dao;

import org.springframework.jdbc.core.simple.SimpleJdbcDaoSupport;

import com.cqcis.uip.base.framework.utils.JdbcUtil;
import com.cqcis.uip.module.salary.oper.SalaryConstants;
import com.cqcis.uip.module.salary.oper.domain.SalaryTrusteeshipDetail;

/**
 * @author 李世军
 *
 * 创建于 2012-3-21 下午02:41:49
 */
public class SalaryTrusteeshipDetailDao extends SimpleJdbcDaoSupport {
	private static String INSERT_SQL = " insert into financecontrol_salarytrusteeshipdetail(employe_id,student_id,grade_id,course_id,days,fee,month,remark) "
		+ " values(:employe_id,:student_id,:grade_id,:course_id,:days,:fee,:month,:remark) ";

	private static String DELETE_SQL = " delete from financecontrol_salarytrusteeshipdetail where month>=? and month<=?   ";
	
	/**
	 * 保存
	 * 
	 * @param salaryMain
	 */
	public void insert(SalaryTrusteeshipDetail detail) {
		detail.setMonth(SalaryConstants.SALARY_GENERATE_DATE);
		JdbcUtil.update(INSERT_SQL, detail, this);
	}
	
	/**
	 * 删除当月数据
	 */
	public void delete() {
		JdbcUtil.update(this, DELETE_SQL, SalaryConstants.SALARY_BEGIN_DATE, SalaryConstants.SALARY_END_DATE);
	}
}
